//左侧点击出现下拉菜单事件
//获取元素
const down = document.querySelector('.zhanghao')
const renzheng = document.querySelector('.renzheng')
const xia = document.querySelector('.icon-xiangxiajiantou')
const shouye = document.querySelector('.shouye')
//////
//点击切换
const neirong = document.querySelector('.neirong')
const body = document.querySelector('.body')
const foot = document.querySelector('.footer')
//点击事件
let flag = false
let deg = 0
down.addEventListener('click', function () {
  deg += 180
  if (deg === 360) {
    deg = 0
  }
  if (!flag) {
    renzheng.style.opacity = '1'
    xia.style.transform = `rotate(${deg}deg)`
    flag = !flag
  } else {
    renzheng.style.opacity = '0'
    xia.style.transform = `rotate(${deg}deg)`
    flag = !flag
  }
})
renzheng.addEventListener('click', function () {
  renzheng.classList.add('active')
  renzheng.style.backgroundColor = "rgb(244, 247, 255)"
  renzheng.style.color = "rgb(91, 146, 225)"
  neirong.style.display = 'none'
  body.style.display = 'block'
  foot.style.display = 'none'

})
shouye.addEventListener('click', function () {
  if (flag) {
    renzheng.style.opacity = '0'
    xia.style.transform = `rotate(0deg)`
    deg = 0
    flag = !flag
  }
  neirong.style.display = 'block'
  body.style.display = 'none'
  foot.style.display = 'block'

})
const a = document.querySelector('.aa')

a.addEventListener('click', function (e) {
  e.preventDefault()
  neirong.style.display = 'none'
  body.style.display = 'block'
  renzheng.style.opacity = '1'
  xia.style.transform = `rotate(180deg)`
  renzheng.classList.add('active')
  renzheng.style.backgroundColor = "rgb(244, 247, 255)"
  renzheng.style.color = "rgb(91, 146, 225)"
  foot.style.display = 'none'

  deg = 180
  flag = !flag
})



const zhengjian = document.querySelector('.zhengjian')
const q1 = document.querySelector('.q1')
const q2 = document.querySelector('.q2')
const zz = document.querySelector('#dd')
const z = document.querySelector('.z')
function none() {
  zhengjian.style.display = 'none'
}
q2.addEventListener('click', none)
zz.addEventListener('click', none)
function block() {
  zhengjian.style.display = 'block'
  zhengjian.style.display = 'flex'
}
q1.addEventListener('click', block)
z.addEventListener('click', block)


const e = document.querySelector('.e')
const ee = document.querySelector('.ee')
const r = document.querySelector('.r')
const rr = document.querySelector('.rr')
const box1 = document.querySelector('.boxx1')
const box2 = document.querySelector('.boxx2')
const fi = document.querySelector('.fi')
function none1() {
  box1.style.display = 'none'
  box2.style.display = 'block'
  box2.style.display = "flex"
}
ee.addEventListener('click', none1)
rr.addEventListener('click', none1)
function block1() {
  box1.style.display = 'block'
  box2.style.display = 'none'
}
e.addEventListener('click', block1)
r.addEventListener('click', block1)


